<UserControl x:Class="BookDemoApp.UCClippingTransparency"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:BookDemoApp">
  <DockPanel>
    <local:UCTitle DockPanel.Dock="Top" DataContext="Opacity mask and Alpha transparency" />
    <Rectangle>
      <Rectangle.Fill>
        <RadialGradientBrush>
          <GradientStop Offset="0" Color="Red" />
          <GradientStop Offset="0.4" Color="Red" />
          <GradientStop Offset="1" Color="Transparent" />
        </RadialGradientBrush>
      </Rectangle.Fill>
      <Rectangle.OpacityMask>
        <DrawingBrush TileMode="Tile" Viewport="0.1 0.1 0.1 0.1" ViewportUnits="RelativeToBoundingBox" >
          <DrawingBrush.Drawing>
            <GeometryDrawing Brush="Black">
              <GeometryDrawing.Geometry>
                <EllipseGeometry RadiusX="10" RadiusY="10" />
              </GeometryDrawing.Geometry>
            </GeometryDrawing>
          </DrawingBrush.Drawing>
        </DrawingBrush>
      </Rectangle.OpacityMask>
    </Rectangle>
  </DockPanel>
</UserControl>
